package com.douya.pangu.application.sys.service;

import com.douya.pangu.application.basic.mapper.CoreUserMapper;
import com.douya.pangu.application.basic.pojo.entity.CoreUserDO;

import com.douya.pangu.application.basic.service.CoreUserService;
import com.douya.pangu.application.sys.mapper.CorePermissionMapper;
import com.douya.pangu.application.sys.mapper.CoreRoleMapper;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Objects;

/**
 * 用户信息
 *
 * @author hcy
 * @date 2019-11-22 16:26
 */
@Service
public class UserDetailsServiceImpl implements UserDetailsService {

    @Resource
    CoreUserService mCoreUserService;

    @Override
    public UserDetails loadUserByUsername(String id) throws UsernameNotFoundException {
        return mCoreUserService.selectByUserId(Long.valueOf(id));
    }

}
